import re
import unittest

class Foo:
   def foo(self, command, lines):      
      return "2"

class FooFileTestCase(unittest.TestCase):
   def setUp(self):
     self.test = Foo()

   def testfoo(self):
      lines = ['xover -100\r\n','xover 10-10\r\n','xover 10-','XOVER 10-100\r\n',
      'mode ','mode reader\r\n','mode stream\r\n','mode case\r\n',
      'group ','Group 10-10\r\n','GROUP cn.test\r\n','gRoUp cn.t1,cn.t2\r\n',
      'list','list ','list active',
       'newgroups aaa bbb gmt','newgroups 11','newgroups 060606121212','newgroups 060606 121212 GMT',
      '',''
      ]
      command = (r'^mode [reader|stream]',
                r'^list [active|active.times|newsgroups|subscriptions]',
                r'^xover [0-9]+-[0-9]+',
                r'^group .+',
                r'^newgroups [0-9]+ [0-9]+ GMT'
                )
      self.assertEqual(self.test.foo(command, lines), "1")

def suite():
    suite = unittest.TestSuite()
    suite.addTest(FooFileTestCase('testfoo'))

    return suite

if __name__ == "__main__":

    unittest.main(defaultTest = 'suite')
